﻿using System;
using System.Collections;
using System.Collections.Generic;

namespace UniRx
{
	// Token: 0x020003A7 RID: 935
	[Serializable]
	public struct Tuple<T1, T2, T3, T4> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple, IEquatable<Tuple<T1, T2, T3, T4>>
	{
		// Token: 0x060012F6 RID: 4854 RVA: 0x00056D19 File Offset: 0x00055119
		public Tuple(T1 item1, T2 item2, T3 item3, T4 item4)
		{
			this.item1 = item1;
			this.item2 = item2;
			this.item3 = item3;
			this.item4 = item4;
		}

		// Token: 0x17000133 RID: 307
		// (get) Token: 0x060012F7 RID: 4855 RVA: 0x00056D38 File Offset: 0x00055138
		public T1 Item1
		{
			get
			{
				return this.item1;
			}
		}

		// Token: 0x17000134 RID: 308
		// (get) Token: 0x060012F8 RID: 4856 RVA: 0x00056D40 File Offset: 0x00055140
		public T2 Item2
		{
			get
			{
				return this.item2;
			}
		}

		// Token: 0x17000135 RID: 309
		// (get) Token: 0x060012F9 RID: 4857 RVA: 0x00056D48 File Offset: 0x00055148
		public T3 Item3
		{
			get
			{
				return this.item3;
			}
		}

		// Token: 0x17000136 RID: 310
		// (get) Token: 0x060012FA RID: 4858 RVA: 0x00056D50 File Offset: 0x00055150
		public T4 Item4
		{
			get
			{
				return this.item4;
			}
		}

		// Token: 0x060012FB RID: 4859 RVA: 0x00056D58 File Offset: 0x00055158
		int IComparable.CompareTo(object obj)
		{
			return ((IStructuralComparable)this).CompareTo(obj, Comparer<object>.Default);
		}

		// Token: 0x060012FC RID: 4860 RVA: 0x00056D70 File Offset: 0x00055170
		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is Tuple<T1, T2, T3, T4>))
			{
				throw new ArgumentException("other");
			}
			Tuple<T1, T2, T3, T4> tuple = (Tuple<T1, T2, T3, T4>)other;
			int num = comparer.Compare(this.item1, tuple.item1);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(this.item2, tuple.item2);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(this.item3, tuple.item3);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(this.item4, tuple.item4);
		}

		// Token: 0x060012FD RID: 4861 RVA: 0x00056E31 File Offset: 0x00055231
		public override bool Equals(object obj)
		{
			return ((IStructuralEquatable)this).Equals(obj, EqualityComparer<object>.Default);
		}

		// Token: 0x060012FE RID: 4862 RVA: 0x00056E4C File Offset: 0x0005524C
		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (!(other is Tuple<T1, T2, T3, T4>))
			{
				return false;
			}
			Tuple<T1, T2, T3, T4> tuple = (Tuple<T1, T2, T3, T4>)other;
			return comparer.Equals(this.item1, tuple.item1) && comparer.Equals(this.item2, tuple.item2) && comparer.Equals(this.item3, tuple.item3) && comparer.Equals(this.item4, tuple.item4);
		}

		// Token: 0x060012FF RID: 4863 RVA: 0x00056EF4 File Offset: 0x000552F4
		public override int GetHashCode()
		{
			EqualityComparer<T1> @default =EqualityComparer<T1>.Default;
			EqualityComparer<T2> default2 = EqualityComparer<T2>.Default;
			EqualityComparer<T3> default3 = EqualityComparer<T3>.Default;
			EqualityComparer<T4> default4 = EqualityComparer<T4>.Default;
			int num = @default.GetHashCode(this.item1);
			num = ((num << 5) + num ^ default2.GetHashCode(this.item2));
			int num2 = default3.GetHashCode(this.item3);
			num2 = ((num2 << 5) + num2 ^ default4.GetHashCode(this.item4));
			return (num << 5) + num ^ num2;
		}

		// Token: 0x06001300 RID: 4864 RVA: 0x00056F70 File Offset: 0x00055370
		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			int num = comparer.GetHashCode(this.item1);
			num = ((num << 5) + num ^ comparer.GetHashCode(this.item2));
			int num2 = comparer.GetHashCode(this.item3);
			num2 = ((num2 << 5) + num2 ^ comparer.GetHashCode(this.item4));
			return (num << 5) + num ^ num2;
		}

		// Token: 0x06001301 RID: 4865 RVA: 0x00056FDC File Offset: 0x000553DC
		string ITuple.ToString()
		{
			return string.Format("{0}, {1}, {2}, {3}", new object[]
			{
				this.item1,
				this.item2,
				this.item3,
				this.item4
			});
		}

		// Token: 0x06001302 RID: 4866 RVA: 0x00057031 File Offset: 0x00055431
		public override string ToString()
		{
			return "(" + ((ITuple)this).ToString() + ")";
		}

		// Token: 0x06001303 RID: 4867 RVA: 0x00057054 File Offset: 0x00055454
		public bool Equals(Tuple<T1, T2, T3, T4> other)
		{
			EqualityComparer<T1> @default =EqualityComparer<T1>.Default;
			EqualityComparer<T2> default2 = EqualityComparer<T2>.Default;
			EqualityComparer<T3> default3 = EqualityComparer<T3>.Default;
			EqualityComparer<T4> default4 = EqualityComparer<T4>.Default;
			return @default.Equals(this.item1, other.item1) && default2.Equals(this.item2, other.item2) && default3.Equals(this.item3, other.item3) && default4.Equals(this.item4, other.item4);
		}

		// Token: 0x04000B4E RID: 2894
		private T1 item1;

		// Token: 0x04000B4F RID: 2895
		private T2 item2;

		// Token: 0x04000B50 RID: 2896
		private T3 item3;

		// Token: 0x04000B51 RID: 2897
		private T4 item4;
	}
}
